local MainItem = MainItem or BaseClass(BaseItem)
local _AddClickEvent = AddClickEvent
local _LuaEMgr = LuaEventManager:GetInstance()

function MainItem:__init(parent)
	self.base_file = "Main"
	self.layout_file = "MainItem"
	self:Load()
end

function MainItem:LoadSuccess()
	self.icon = self.transform:Find("icon")
	self.icon_obj = self.icon.gameObject
	self:initEvent()
end

function MainItem:initEvent()
	local function onClickHandler(target, x, y)
		-- BagModel:GetInstance():Fire(BagModel.EVENT_NAME.OPEN_BAG_VIEW)
		_LuaEMgr:Trigger(EVENT_NAME.OPEN_BAG_VIEW)
	end
	_AddClickEvent(self.icon_obj, onClickHandler)
end

return MainItem